import React, {
    Component
} from "react";
import {
    Modal,
    Tooltip,
    Form,
    Table,
    Row,
    Col,
    Spin,
    Button
} from 'antd';
import PropsType from "prop-types";

class UpgradeSuccessModal extends Component {
    constructor(props) {
        super(props);
    }

    handleUpgradeSuccessCancel = (e) => {
        this.props.handleCancel();
    }

    openTab(param, e) {
        this.handleUpgradeSuccessCancel();
        this.props.onAdd.bind(window.LayoutTab)(e, param);
    }

    render() {
        return (
            <Modal title="远程升级" visible={this.props.visible} footer=
            {
            <div style={{
                'textAlign': 'center'
            }}>
                        <Button onClick={this.handleUpgradeSuccessCancel}>我知道了</Button>
                        <Button onClick={() => this.openTab({}, {
                'key': '030106',
                titleText: '远程升级'
            })}>查看进度</Button>
                    </div>
            }
            onCancel={this.handleUpgradeSuccessCancel}>
                <p style={{
                'textAlign': 'center',
                'margin': '0px 5rem',
                'lineHeight': '2rem'
            }}>升级进行中，关闭窗口不影响升级进程。可在【远程升级】菜单查看升级进度。</p>
            </Modal>
        )
    }
}
export default UpgradeSuccessModal;

UpgradeSuccessModal.propTypes = {
    onAdd: PropsType.func
}